package com.itsense.stock.mapper;

import com.itsense.stock.pojo.domain.SysUserDomain;
import com.itsense.stock.pojo.domain.SysUserSelectDomain;
import com.itsense.stock.pojo.domain.SysUserUpdateDomain;
import com.itsense.stock.pojo.entity.SysUser;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;

/**
* @author sense
* @description 针对表【sys_user(用户表)】的数据库操作Mapper
* @createDate 2024-12-30 20:59:30
* @Entity com.itsense.stock.pojo.entity.SysUser
*/
public interface SysUserMapper {

    int deleteByPrimaryKey(Long id);

    int insert(SysUser record);

    int insertSelective(SysUser record);

    SysUser selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(SysUser record);

    int updateByPrimaryKey(SysUser record);

    SysUser findUserInfoByUserName(@Param("userName") String userName);

    /**
     * 查询所有用户信息
     * @return
     */
    List<SysUser> findAll();

    /**
     * 查询所有用户信息
     * @param username
     * @param nickName
     * @param startTime
     * @param endTime
     * @return
     */
    List<SysUserDomain> getUserByPage(@Param("userName") String username, @Param("nickName")String nickName, @Param("startTime") Date startTime, @Param("endTime") Date endTime);

    /**
     * 批量删除用户的角色信息
     * @param ids
     * @return
     */
    int deleteUser(@Param("ids") List<Long> ids);

    /**
     * 通过id查询用户信息
     * @param userId
     * @return
     */
    SysUserSelectDomain selectByUserId(@Param("userId") String userId);

    /**
     * 通过id修改用户信息
     * @return
     */
    int updateUserByUserId(@Param("updateDomain") SysUserUpdateDomain updateDomain);
}
